package com.wc.alorithm_luogu.P5732;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/22 11:41
 * @description https://www.luogu.com.cn/problem/P5732
 * 杨辉三角
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[][] triangle = new int[n+1][];
        triangle[0] = new int[]{1};
        triangle[1] = new int[]{1, 1};
        int[] row;

        for (int i = 2; i < n; i++) {
            row = new int[i + 1];
            row[0] = 1;
            for (int j = 1; j < i; j++) {
                row[j] = triangle[i - 1][j - 1] + triangle[i - 1][j];
            }
            row[i] = 1;
            triangle[i] = row;
        }
        for (int i = 0; i < n; i++) {
            row = triangle[i];
            System.out.print(row[0]);
            for (int j = 1; j < row.length; j++) {
                System.out.print(" " + row[j]);
            }
            System.out.println();
        }
    }
}
